<template>
 <div class="editmanage container">
  <form class="form" v-on:submit="editManage">
   <div class="form-group">
    <label>账号</label>
    <input type="text" required placeholder="账号" autocomplete="off" class="form-control" v-model="manage.account">
   </div>
   <div class="form-group">
    <label>用户名</label>
    <input type="text" required placeholder="用户名" autocomplete="off" class="form-control" v-model="manage.username">
   </div>
   <div class="form-group">
    <label >密码</label>
    <input type="password" required placeholder="密码" autocomplete="off" class="form-control" v-model="manage.password">
   </div>
 
   <div class="form-group">
    <label >权限</label>
    <select name="authority" class="form-control" v-model="manage.authority">
     <option value="超级管理员" >超级管理员</option>
     <option value="普通管理员" >普通管理员</option>
    </select>
   </div>
   <button type="submit" class="btn btn-info">立即提交</button>
  </form>
 </div>
</template>
 
<script>
 export default {
  name: 'addmanage',
  data () {
   return {
    manage:{},
    form:{}
   }
  },
  props:{
  //接收父组件传来的id值
   info:{
    type:Object,
    default:()=>{
     return {}
    }
   },
   layerid:{
    type:String,
    default:""
   },
   lydata:{
    type:Object,
    default:()=>{
     return {}
    }
   }
  },
  methods:{
  //用来显示对应id的编辑内容，在created中调用
   fetchManage(id){
    console.info(id);
   },
   editManage(e){
    
    e.preventDefault()
   }
  },
  created(){
  // this.info.id父组件传给子组件的id值
   this.fetchManage(this.info.id);
  }
 }
</script>
 
<style scoped>
 .editmanage{
  margin:8px 20px 20px 20px;
 }
</style>